﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ECONTACT.Bussiness;
using ECONTACT.DataLayer;
using System.Data;
using System.Windows.Forms;
using DevComponents.DotNetBar.Controls;
using DevComponents.Editors.DateTimeAdv;

namespace ECONTACT.Controller
{
    public class PhanLopCtrl
    {

        PhanLopData m_PhanLopData = new PhanLopData();

        #region Do du lieu vao DataGridView

        public void HienThi(DataGridViewX dGV,
                            ComboBoxEx txtMaLop,
                            ComboBoxEx txtMaHS)
        {
            BindingSource bS = new BindingSource();
            bS.DataSource = m_PhanLopData.LayDsPhanLop();

            DataTable dT = m_PhanLopData.LayDsPhanLop();

            txtMaLop.DataBindings.Clear();
            txtMaLop.DataBindings.Add("SelectedValue", bS, "MaLop");

            txtMaHS.DataBindings.Clear();
            txtMaHS.DataBindings.Add("SelectedValue", bS, "MaHS");

            //bN.BindingSource = bS;
            dGV.DataSource = bS;
        }
        #endregion

        public void LuuPhanLop(String MaLop,String MaHS)
        {
            m_PhanLopData.LuuPhanLop(MaLop, MaHS);
        }
    }
}
